<?php 
/**
 * 
 * 任务 处理类
 * @author tanzhe
 *
 */
class task {
	
	public function get() { //查看当前任务的任务状态
		$url = new Url();
	  	$key = $url->get('key');
		$taskModel = new TaskModel(); 
		$ret = $taskModel->getTask($key);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}
	
	public function isFinish() { //查看任务是否完成
		$url = new Url();
	  	$key = $url->get('key');
		$taskModel = new TaskModel(); 
		$ret = $taskModel->isFinish($key);
		echo $ret;
		//$callback = $url->get('jsonpcallback');
		//Json::do_jsonp_encode($callback,$ret);
	}
	
	public function getBonus() { //获取任务奖励
		$url = new Url();
	  	$key = $url->get('key');
		$taskModel = new TaskModel(); 
		$ret = $taskModel->getBonus($key);
		
		$callback = $url->get('jsonpcallback');
		Json::do_jsonp_encode($callback,$ret);
	}
}
?>